<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>自助推广码</title>

	<link rel="stylesheet" href="/layui/layui.css">
	<link rel="stylesheet" href="/css/mission.css">

	<style type="text/css">
		html {
			height: 100%;
			overflow: hidden;
		}

		body {
			background: #f0f2f5;
			height: 100%;
			font-size: 14px;
		}

		.creatCode_container {
			height: 100%;
			padding: 20px;
			box-sizing: border-box;
			display: flex;
		}

		.creatCodeFrom_container {
			height: 100%;
			box-sizing: border-box;
			display: flex;
			flex: 1;
		}

		.creatCode_right_container::-webkit-scrollbar {
			/*滚动条整体样式*/
			width: 5px;
			/*高宽分别对应横竖滚动条的尺寸*/
			height: 1px;
		}

		.creatCode_right_container::-webkit-scrollbar-thumb {
			/*滚动条里面小方块*/
			border-radius: 10px;
			box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
			background: #ccc;
		}

		.creatCode_right_container::-webkit-scrollbar-track {
			/*滚动条里面轨道*/
			box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
			border-radius: 10px;
			background: #ededed;
		}

		.form-item-right-swicth-container {
			display: flex;
			align-items: center;
		}

		.form-item-right-swicth-container span {
			margin-left: 10px;
			color: rgba(0, 0, 0, .45);
			flex: 1;
			margin-top: 8px;
		}

		/*左*/
		.creatCode_left_container {
			width: 154px;
			min-width: 154px;
			height: 100%;
			background: #fff;
			padding: 24px 0 24px 24px;
			color: rgba(0, 0, 0, .45);
			box-sizing: border-box;
		}

		.creatCode_leftProgress_container {}

		.creatCode_leftProgress_container li {
			position: relative;
			margin-bottom: 32px;
		}

		.creatCode_leftProgress_content {
			display: flex;
			align-items: center;
		}

		.creatCode_leftProgress_content label {
			width: 20px;
			height: 20px;
			border-radius: 100%;
			background: #ccd5de;
			text-align: center;
			color: #fff;
			display: block;
			line-height: 20px;
		}

		.creatCode_leftProgress_content span {
			margin-left: 14px;
			font-size: 14px;
			flex: 1;
		}

		.creatCode_leftProgressLine {
			position: absolute;
			width: 1px;
			height: 31px;
			border-left: 1px dashed #d8d8d8;
			left: 10px;
			top: 20px;
			z-index: 1;
		}

		.prevButton {
			color: #1990ff;
			border: 1px solid #108ee9;
			margin-bottom: 12px;
			border-radius: 2px;
			width: 104px;
			height: 36px;
			border-radius: 2px;
			display: flex;
			align-items: center;
			justify-content: center;
			cursor: pointer;
			box-sizing: border-box;
		}
		.nextButton {
			color: #fff;
			background: #1890ff;
			width: 104px;
			height: 36px;
			border-radius: 2px;
			display: flex;
			align-items: center;
			justify-content: center;
			cursor: pointer;
			box-sizing: border-box;
			border: none;
			margin-bottom: 12px;
		}

		.acticeProgress label {
			background: #1890ff;
		}

		.acticeProgress span {
			color: #1890ff;
		}

		/*右*/
		.creatCode_right_container {
			-webkit-box-flex: 1;
			flex: 1;
			padding: 24px 24px 24px 0;
			max-height: 100%;
			overflow-y: auto;
			margin-left: 8px;
			background: #fff;
			min-width: 810px;
		}

		/* 基础设置 */
		.BasicSettings_container {}

		.promotionMembers_container {
			display: flex;
			align-items: center;
		}

		.promotionMembers_container button {}

		.promotionMembers_container p {
			flex: 1;
			color: rgba(0, 0, 0, .45);
			margin-left: 10px;
		}

		.promotionMembersList_container {
			display: -webkit-box;
			display: flex;
			flex-wrap: wrap;
			margin-top: 13px;
			margin-bottom: -13px;
		}

		.promotionMembersList_container li {
			display: -webkit-box;
			display: flex;
			-webkit-box-align: center;
			align-items: center;
			background: #f8f8f8;
			border-radius: 2px;
			padding: 10px 16px 10px 10px;
			font-size: 14px;
			font-weight: 400;
			color: #666;
			margin-right: 16px;
			margin-bottom: 13px;
			position: relative;
		}

		.promotionMembersList_container li img {
			width: 28px;
			height: 28px;
			margin-right: 5px;
		}

		.promotionMembersList_container li span {
			color: #666;
		}

		.promotionMembersList_container li svg {
			position: absolute;
			font-size: 14px;
			line-height: 0;
			right: -6px;
			top: -6px;
			cursor: pointer;
			color: #c7c7c7;
			background-color: #fff;
		}

		.everyDayTips_container {}

		.everyDayTipsUp_content {
			font-size: 14px;
			font-weight: 400;
			color: rgba(0, 0, 0, .45);
			line-height: 20px;
			margin-top: 8px;
		}

		.everyDayTipsDown_content {
			display: flex;
			align-items: center;
			font-size: 14px;
			font-weight: 400;
			margin-top: 8px;
			color: rgba(0, 0, 0, .45);
		}

		.everyDayTipsDown_content input {
			margin: 0 5px;
		}

		/* 客户设置 */
		.rightHidden_container {
			margin-top: 10px;
		}

		/*客户设置 标签部分 start*/
		.customerLabel_mainList_content {
			flex: 1;
			padding-right: 245px;
			display: flex;
			-webkit-box-align: center;
			align-items: center;
			flex-wrap: wrap;
			padding-top: 5px;
		}

		.customerLabel_mainList_content li {
			height: 28px;
			display: -webkit-box;
			display: flex;
			-webkit-box-pack: center;
			justify-content: center;
			-webkit-box-align: center;
			align-items: center;
			padding-left: 14px;
			padding-right: 14px;
			border: 1px solid #e9e9e9;
			color: rgba(0, 0, 0, .65);
			font-size: 14px;
			background: #f7f7f7;
			margin-right: 10px;
			margin-bottom: 10px;
			position: relative;
		}

		.add_active {
			height: 28px;
			width: 50px;
			display: -webkit-box;
			display: flex;
			-webkit-box-pack: center;
			justify-content: center;
			-webkit-box-align: center;
			align-items: center;
			padding-left: 14px;
			padding-right: 14px;
			border: 1px solid #e9e9e9;
			color: rgba(0, 0, 0, .65);
			font-size: 14px;
			background: #f7f7f7;
			margin-right: 10px;
			margin-bottom: 10px;
			position: relative;
			box-shadow: 0 2px 0 rgba(0, 0, 0, .015) !important;
			cursor: pointer;
		}

		.add_active:hover {
			border-color: #40a9ff;
			color: #40a9ff;
			transition: all .3s
		}

		.inputLable {
			height: 28px;
			margin-bottom: 10px;
			outline: none;
			background: #fff;
			border: 1px solid #ececec;
			/*border-radius: 5px;*/
			padding: 0 10px;
			width: 111px;
			margin-right: 10px;
		}

		.inputLable:focus {
			border-color: #40a9ff;
		}

		.deleteLabel {
			position: absolute;
			width: 10px;
			height: 10px;
			right: -5px;
			top: -4px;
			background: #a2a2a2;
			border-radius: 50%;
			padding: 2px;
			cursor: pointer;
		}

		/*客户设置 标签部分 end*/
		.customerRemarks_input_container {
			display: flex;
			align-items: center;
			border: 1px solid #ececec;
			height: 34px;
			line-height: 34px;
			width: 400px;

		}

		.customerRemarks_input_container span {
			font-size: 14px;
			color: rgba(0, 0, 0, .65);
			margin-right: 5px;
			padding: 0 10px;
			border-right: 1px solid #ececec;
		}

		.customerRemarks_input_container input {
			appearance: none;
			border: none;
			flex: 1;
			height: 34px;
			line-height: 34px;
			padding-left: 10px;
		}

		.customerRemarks_show_container {
			margin-top: 10px;
			display: flex;
			align-items: center;
		}

		.customerRemarks_show_container label {
			color: rgba(0, 0, 0, .65);
		}

		.customerRemarks_show_content {
			display: flex;
			align-items: center;
			border: 1px solid #ececec;
			padding: 0 10px;
			border-radius: 4px;
			height: 50px;
			background: #fff;
		}

		.customerRemarks_show_content img {
			width: 34px;
			height: 34px;
			border-radius: 2px;
		}

		.customerRemarks_show_content span {
			color: rgba(0, 0, 0, .55);
			font-size: 14px;
			margin-left: 5px;
		}

		.customerRemarks_show_content b {
			color: rgba(0, 0, 0, .85);
			font-weight: 400;
			font-size: 14px;
			margin-left: 5px;
		}

		/* 拖拽部分 */
		.PopSetting_ExhibitionSwitch_customImg_container {
			display: flex;
			align-items: flex-end;
			margin-top: 12px;
		}

		.PopSetting_ExhibitionSwitch_customImg_content {
			width: 167px;
			height: 297px;
			background: #fff;
			border-radius: 4px;
			border: 1px dashed #ddd;
			-webkit-box-pack: center;
			justify-content: center;
			overflow: hidden;
			position: relative;
		}

		.customImgBG {
			height: 100%;
			display: block;
		}

		#draggable {
			position: absolute;
			top: 0px;
			left: 0px;
			cursor: pointer;
		}

		.AbsoluteQrcode {
			width: 50px;
			height: 50px;
			position: absolute;
			top: 0;
			left: 0;
			cursor: pointer;
			user-select: none;
		}

		.AbsoluteQrcode img {
			display: block;
			height: 100%;
			width: 100%;
		}

		#draggable img {
			-webkit-user-drag: none;
			-moz-user-drag: none;
			-ms-user-drag: none;
			-o-user-drag: none;
		}

		.PopSetting_ExhibitionSwitch_customImg_content p {
			position: absolute;
			font-size: 12px;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			text-align: center;
		}

		.PopSetting_ExhibitionSwitch_customImg_container span {
			margin-left: 12px;
			font-size: 14px;
			color: #1890ff;
			line-height: 20px;
		}

		.draggable_container {
			display: flex;
		}

		.draggableTips_container {
			margin-top: 12px;
		}

		.PopSetting_ExhibitionSwitch_customTips_content {
			background: #fff7f0;
			border-radius: 2px;
			padding: 12px 13px;
			-webkit-box-align: start;
			align-items: flex-start;
			font-size: 13px;
			color: #bb5223;
			line-height: 22px;
			box-sizing: border-box;
			border: 1px solid #ffdcc9;
		}

		.PopSetting_ExhibitionSwitch_customTips_content p {
			font-size: 13px;
			color: #bb5223;
			line-height: 22px;
		}

		.PopSetting_ExhibitionSwitch_customTips_content p {
			font-size: 13px;
			color: #bb5223;
			line-height: 22px;
		}

		/* 客户群设置 */
		.public_iconTips_container {
			display: flex;
			align-content: center;
			padding: 7px 12px;
			background: #effaff;
			border-radius: 2px;
			width: 470px;
		}

		.public_iconTips_container svg {
			padding-top: 2px;
			margin-right: 5px;
		}

		.public_iconTips_container p {
			font-size: 13px;
			color: rgba(0, 0, 0, .65);
			line-height: 19px;
			flex: 1;
		}

		.public_upImg_content {
			display: flex;
			align-items: flex-start;
		}

		.public_upImage_container {
			width: 130px;
			height: 130px;
			border: 1px dashed #d9d9d9;
			background: #fff;
			border-radius: 2px;
			box-sizing: border-box;
			overflow: hidden;
		}

		.public_upImage_container img {
			display: block;
			height: 100%;
		}

		.groupTalkQrCode_listMainRight_uploadImg_container span {
			font-size: 14px;
			color: #1890ff;
			line-height: 20px;
			cursor: pointer;
		}

		.groupTalkQrCode_container {
			border-radius: 2px;
			border: 1px solid #eee;
			padding: 16px 4px 16px 24px;
			width: 440px;
			background: #fbfbfb;
			margin-top: 20px;
		}

		.groupTalkQrCode_list_container {
			overflow-x: hidden;
			overflow-y: auto;
			max-height: 400px;
		}

		.groupTalkQrCode_list_container::-webkit-scrollbar {
			/*滚动条整体样式*/
			width: 5px;
			/*高宽分别对应横竖滚动条的尺寸*/
			height: 1px;
		}

		.groupTalkQrCode_list_container::-webkit-scrollbar-thumb {
			/*滚动条里面小方块*/
			border-radius: 10px;
			box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
			background: #ccc;
		}

		.groupTalkQrCode_list_container::-webkit-scrollbar-track {
			/*滚动条里面轨道*/
			box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
			border-radius: 10px;
			background: #ededed;
		}

		.addGroupButton_container {
			display: flex;
			align-items: center;
			margin-top: 10px;
			cursor: pointer;
			width: 100px;
		}

		.addGroupButton_container span {
			width: 25px;
			height: 25px;
			border-radius: 50%;
			background: #eee;
			color: #adadad;
			font-size: 18px;
			display: flex;
			align-items: center;
			justify-content: center;
		}

		.addGroupButton_container p {
			font-size: 13px;
			margin-left: 8px;
			color: rgba(0, 0, 0, .85);
			margin-left: 5px;
		}

		.groupTalkQrCode_list_container li {
			height: 100%;
			width: 300px;
			background: #fff;
			padding: 12px 0 12px 12px;
			border: 1px solid hsla(0, 0%, 59.2%, .08);
			margin-top: 8px;
			position: relative;
		}

		.groupTalkQrCode_list_container li svg {
			width: 20px;
			height: 20px;
			cursor: pointer;
			background: #fff;
			position: absolute;
			right: -35px;
			bottom: 0;
			padding: 5px;
		}

		.groupTalkQrCode_listTitle_container {}

		.groupTalkQrCode_listTitle_container p {
			color: rgba(0, 0, 0, .65);
			font-size: 14px;
		}

		.groupTalkQrCode_listMain_container {
			margin-top: 10px;
		}

		.groupTalkQrCode_listMainRight_container {
			margin-left: 12px;
			height: 130px;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
		}

		.groupTalkQrCode_listMainRight_addGroup_container {}

		.groupTalkQrCode_listMainRight_addGroup_content {
			display: -webkit-box;
			display: flex;
			-webkit-box-pack: center;
			justify-content: center;
			-webkit-box-align: center;
			align-items: center;
			width: 142px;
			height: 46px;
			background: #fff;
			border-radius: 2px;
			border: 1px solid #e8e8eb;
			font-size: 14px;
			color: rgba(0, 0, 0, .65);
			cursor: pointer;
		}

		.groupTalkQrCode_listMainRight_addGroupDetail_container {
			max-width: 144px;
			max-height: 48px;
			-webkit-box-flex: 1;
			flex: 1;
			height: 60px;
			background: #fff;
			border: 1px solid #e6e6e6;
			box-sizing: border-box;
			border-radius: 1px;
			display: -webkit-box;
			display: flex;
			-webkit-box-align: center;
			align-items: center;
			margin-right: 8px;
			position: relative;
			padding: 8px;
		}

		.groupTalkQrCode_listMainRight_addGroupDetail_container img {
			width: 32px;
			height: 32px;
			margin-right: 8px;
		}

		.groupTalkQrCode_listMainRight_addGroupDetail_content {
			overflow: hidden;
		}

		.groupTalkQrCode_listMainRight_addGroupDetail_content p {
			width: 100%;
			color: #222;
			font-size: 14px;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			position: relative;
		}

		.groupTalkQrCode_listMainRight_addGroupDetail_content span {
			color: #999;
			opacity: .85;
			font-size: 13px;
			display: block;
		}

		.groupTalkQrCode_listMainRight_number_container {
			display: flex;
			align-items: center;
		}

		.groupTalkQrCode_listMainRight_number_container span {
			color: #000;
			font-size: 14px;
		}

		.groupTalkQrCode_listMainRight_number_container input {
			-moz-appearance: textfield !important;
			background-color: transparent;
			border: 0;
			border-radius: 4px;
			height: 32px !important;
			outline: 0;
			padding: 0 11px;
			text-align: left;
			-webkit-transition: all .3s linear;
			transition: all .3s linear;
			width: 100%;
			border: 1px solid #ececec;
			width: 58px !important;
		}

		.groupTalkQrCode_listMainRight_uploadImg_container {}
		.enterGroupText{
			font-size: 14px;
			color: rgba(0,0,0,.45);
			margin-top: 10px;
		}
		.part-time-otype-items .public_form_List{
			margin-top: 10px;
		}
	</style>
</head>

<body>
	<div class="creatCode_container">
		<form class="layui-form creatCodeFrom_container form-label-large" id="form1" lay-filter="formDemo">
			<!-- 左 -->
			<div class="creatCode_left_container">
				<ul class="creatCode_leftProgress_container">
					<li>
						<div class="creatCode_leftProgress_content firstStep acticeProgress">
							<label>1</label>
							<span>基础设置</span>
						</div>
						<div class="creatCode_leftProgressLine"></div>
					</li>
					<li>
						<div class="creatCode_leftProgress_content secendStep">
							<label>2</label>
							<span id="Step2">{if $promoteqr->type == 1} 客户设置 {else} 客户群设置 {/if}</span>
						</div>
						<div class="creatCode_leftProgressLine"></div>
					</li>
					<li>
						<div class="creatCode_leftProgress_content thirdStep">
							<label>3</label>
							<span>海报设置</span>
						</div>
					</li>
				</ul>
				<span class="prevButton">上一步</span>
				<span class="nextButton nextButtons">下一步</span>
				<button class="layui-btn nextButton" lay-submit="" lay-filter="formDemo">开始推广</button>
			</div>
			<!-- 右 -->
			<div class="creatCode_right_container">
				<!-- 基础设置 -->
				<div class="BasicSettings_container">
					<div class="layui-form-item">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							推广码类型:
						</label>
						<div class="layui-input-block" id="TGtypeRadio">
							<input type="radio" lay-filter="TGtype" name="type" value="1" disabled="" title="添加成员" {if $promoteqr->type == 1} checked {/if}>
							<input type="radio" lay-filter="TGtype" name="type" value="2" disabled="" title="加入客户群" {if $promoteqr->type == 2} checked {/if}>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							推广码名称:
						</label>
						<div class="layui-input-block">
							<input type="text" name="name"  value="{$promoteqr->name}" placeholder="推广码名称仅内部可见" autocomplete="off" class="layui-input" lay-verify="required">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							推广成员:
						</label>
						<div class="layui-input-block">
							<div class="promotionMembers_container">
								<button type="button" class="layui-btn layui-btn-primary" id="addPeople">+ 添加成员</button>
								<p>将给选择的成员生成专属分享海报，客户扫码即可添加成员</p>
							</div>
							<ul class="promotionMembersList_container" id="checkUserCon" >
								{loop $promoteqr->users as $user}
									<li>
										<img
											src="{$h->get_user_by_id($promoteqr->wid,$user)['avatar']}" />
										<span>{$h->get_user_by_id($promoteqr->wid,$user)['name']}</span>
									</li>
								{/loop}
							</ul>
						</div>
						<input type="hidden" name="users" id="checkUser" lay-verify="required" value="{implode(',',$promoteqr->users)}">
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">每日提醒：</label>
						<div class="layui-input-block">
							<input type="checkbox" lay-filter="day" name="day" lay-skin="switch" lay-text="已开启|已关闭" {if $promoteqr->remin_status == 1} checked {/if}>
							<div class="everyDayTips_container">
								<div class="everyDayTipsUp_content">
									<p>开启后每日定时汇总员工推广数据并通过「企业提醒」提醒员工</p>
								</div>
								<div class="everyDayTipsDown_content"  {if $promoteqr->remin_status != 1} style="display:none" {/if}>
									<span>每天</span>
									<input type="text" class="layui-input" id="test4" name="day_time" style="width: 80px;" placeholder="选择时间" value="{$promoteqr->ttime}">
									<!-- <span>每天</span> -->
								</div>
							</div>
						</div>
					</div>
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							任务说明：</label>
						<div class="layui-input-block" style="padding-top: 8px;">
							<textarea placeholder="请输入任务说明" class="layui-textarea" id="task_states">{$promoteqr->task_state}</textarea>
							<input type="hidden" name="task_state" id="task_state" value="">
						</div>
					</div>
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							推广文案：</label>
						<div class="layui-input-block" style="padding-top: 8px;">
							<textarea placeholder="请输入推广文案" class="layui-textarea" id="promotion_welcomes">{$promoteqr->promotion_welcome}</textarea>
							<input type="hidden" name="promotion_welcome" id="promotion_welcome">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							推广码失效时间:
						</label>
						<div class="layui-input-block" id="tgCustomTimeSwitch">
							<input type="radio" name="TGtime" lay-filter="TGtime" value="1" title="永久有效" {if $promoteqr->promotion_type == 1}checked {/if}>
							<input type="radio" name="TGtime" lay-filter="TGtime" value="2" title="自定义截止时间" {if $promoteqr->promotion_type == 2}checked {/if}>
						</div>
					</div>
					<div class="layui-form-item" id="tgCustomTime"  {if $promoteqr->promotion_type != 2} style="display: none;" {/if}>
						<label class="layui-form-label"></label>
						<div class="layui-input-inline">
							<input type="text" class="layui-input" id="test5" placeholder="选择截止时间" name="end_time" value="{$promoteqr->end_time}">
						</div>
					</div>
				</div>
				<!-- 客户设置 -->
				<div class="CustomerSettings_container" style="display: none;">
					<div class="layui-form-item">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							好友欢迎语:
						</label>
						<div class="layui-input-block" id="welcomeWordsSwitch">
							<input type="radio" name="welcomeWords" lay-filter="welcomeWords" value="1" title="推广欢迎语" {if $promoteqr->welcome_type == 1} checked {/if}>
							<input type="radio" name="welcomeWords" lay-filter="welcomeWords" value="2" title="不发送欢迎语" {if $promoteqr->welcome_type == 2} checked {/if}>
						</div>
					</div>
					<div id="welcome_Container" {if $promoteqr->welcome_type != 1} style="display: none;" {/if}>
						<div class="public_form_List" id="welcomeContainer">
							<div class="public_formTitle_container">
								<lable class="layui-form-label">欢迎语文字：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<div class="insert-btn">
										<button id="insert" class="layui-btn layui-btn-primary" style="margin-bottom: 5px" type="button" unselectable="on"onmousedown="return false">插入客户名</button>
									</div>
									<div contenteditable="true" id="edit_hy_text_content_div" name="edit_hy_text_content_div" class="layui-textarea">{$promoteqr->welcome_text}</div>
									<input hidden name="welcome_text" id="welcome_text" value="">
								</div>
							</div>
						</div>
					</div>
					<!-- 预留的附件部分 -->
					<div id="part-time-lists" {if $promoteqr->welcome_type != 1} style="display: none;" {/if}>
						<div class="layui-input-block part-time-lists" style="margin-top: 20px;margin-left: 0px;">
							{if count($promoteqr->welcome_list) >= 1}
								{loop $promoteqr->welcome_list as $key=>$list}
									<div class="public_form_List part-time-items" style="position: relative;margin-bottom: 20px;">
										<div class="public_formTitle_container">
											<lable class="layui-form-label part-time-item-indexs">附件{$key+1}：</lable>
										</div>
										<div class="public_formOther_container">
											<div class="layui-input-block" style="padding:10px 20px;background:#fdfdfd;border:1px solid #e5e5e5;">
												<div class="layui-input-block part-time-otype-radiobox" style="margin-left: 0;margin-bottom: 10px;">
													<input class="part-time-form-elems" type="radio" lay-filter="partTimeOtherTypes" name="part_time_other_types{$key+1}" value="1" title="无" {if $list['type'] == 1} checked {/if}>
													<input class="part-time-form-elems" type="radio" lay-filter="partTimeOtherTypes" name="part_time_other_types{$key+1}" value="2" title="图片" {if $list['type'] == 2} checked {/if}>
													<input class="part-time-form-elems" type="radio" lay-filter="partTimeOtherTypes" name="part_time_other_types{$key+1}" value="3" title="图文" {if $list['type'] == 3} checked {/if}>
													<input class="part-time-form-elems" type="radio" lay-filter="partTimeOtherTypes" name="part_time_other_types{$key+1}" value="4" title="小程序" {if $list['type'] == 4} checked {/if}>
													<!-- <input class="part-time-form-elems" type="radio" lay-filter="partTimeOtherTypes" name="part_time_other_types{$key+1}" value="5" title="红包" {if $list['type'] == 5} checked {/if}> -->
												</div>
												<!-- 图片 -->
												<div class="public_form_List part-time-otype-items part_time_otype_imgs" {if $list['type'] != 2} style="display: none;" {/if} >
													<div class="public_formTitle_container">
														<lable class="layui-form-label">图片：</lable>
													</div>
													<div class="public_formOther_container">
														<div class="layui-input-block">
															<img onerror="this.style.display='none'" id="preview_part_time_otype_imgs{$key+1}" class="part-time-img-previews" src="{$list['image']}" style="width: 100px; height: 100px;">
															<input type="hidden" name="image{$key+1}" id="part_time_otype_imgs{$key+1}" class="part-time-form-elems" value="{$list['image']}" />
															<button type="button" class="layui-btn part-time-btn-simgs" data-target="part_time_otype_imgs{$key+1}" onclick="select_img(this)">
																<i class="layui-icon">&#xe67c;</i>上传图片
															</button>
														</div>
													</div>
												</div>
												<!-- 图文 -->
												<div class="public_form_List part-time-otype-items part_time_otype_imgtexts" {if $list['type'] != 3} style="display: none;" {/if}>
													<div class="public_form_List">
														<div class="public_formTitle_container">
															<lable class="layui-form-label">标题：</lable>
														</div>
														<div class="public_formOther_container">
															<div class="layui-input-block">
																<input type="text" name="link_title{$key+1}" id="part_time_otype_it_ltitles{$key+1}"  placeholder="请输入标题" autocomplete="off" class="layui-input part-time-form-elems" value="{$list['title']}">
															</div>
														</div>
													</div>
													<div class="public_form_List">
														<div class="public_formTitle_container">
															<lable class="layui-form-label">链接：</lable>
														</div>
														<div class="public_formOther_container">
															<div class="layui-input-block">
																<input type="text" name="link_url{$key+1}" id="part_time_otype_it_lurls{$key+1}"  placeholder="请输入链接" autocomplete="off" class="layui-input part-time-form-elems" value="{$list['url']}">
															</div>
														</div>
													</div>
													<div class="public_form_List">
														<div class="public_formTitle_container">
															<lable class="layui-form-label">封面：</lable>
														</div>
														<div class="public_formOther_container">
															<div class="layui-input-block">
																<img onerror="this.style.display='none'" id="preview_part_time_otype_it_lpics{$key+1}" class="part-time-img-previews" src="{$list['picurl']}" style="width: 100px; height: 100px;">
																<input type="hidden" name="link_pic{$key+1}" id="part_time_otype_it_lpics{$key+1}" class="part-time-form-elems" value="{$list['picurl']}"/>
																<button type="button" class="layui-btn part-time-btn-simgs" onclick="select_img(this)" data-target="part_time_otype_it_lpics{$key+1}">
																	<i class="layui-icon">&#xe67c;</i>上传图片
																</button>
															</div>
														</div>
													</div>
													<div class="public_form_List">
														<div class="public_formTitle_container">
															<lable class="layui-form-label">描述：</lable>
														</div>
														<div class="public_formOther_container">
															<div class="layui-input-block">
																<input type="text" name="link_desc{$key+1}" id="part_time_otype_it_ldesc{$key+1}" placeholder="请输入描述" autocomplete="off" class="layui-input part-time-form-elems" value="{$list['describe']}">
															</div>
														</div>
													</div>
												</div>
												<!-- 小程序 -->
												<div class="public_form_List part-time-otype-items part_time_otype_mps" {if $list['type'] != 4} style="display: none;" {/if}>
													<div class="public_form_List">
														<div class="public_formTitle_container">
															<lable class="layui-form-label">小程序名称：</lable>
														</div>
														<div class="public_formOther_container">
															<div class="layui-input-block">
																<input type="text" name="miniprogram_name{$key+1}" id="part_time_otype_mp_names{$key+1}"    placeholder="请输入小程序名称" autocomplete="off" class="layui-input part-time-form-elems" value="{$list['name']}">
															</div>
														</div>
													</div>
													<div class="public_form_List">
														<div class="public_formTitle_container">
															<lable class="layui-form-label">小程序ID：</lable>
														</div>
														<div class="public_formOther_container">
															<div class="layui-input-block">
																<input type="text" name="miniprogram_appid{$key+1}" id="part_time_otype_mp_appids{$key+1}"    placeholder="请输入ID" autocomplete="off" class="layui-input part-time-form-elems" value="{$list['appid']}">
															</div>
														</div>
													</div>
													<div class="public_form_List">
														<div class="public_formTitle_container">
															<lable class="layui-form-label">小程序路径：</lable>
														</div>
														<div class="public_formOther_container">
															<div class="layui-input-block">
																<input type="text" name="miniprogram_page{$key+1}" id="part_time_otype_mp_paths{$key+1}"    placeholder="请输入小程序路径" autocomplete="off" class="layui-input part-time-form-elems" value="{$list['page']}">
															</div>
														</div>
													</div>
													<div class="public_form_List">
														<div class="public_formTitle_container">
															<lable class="layui-form-label">小程序标题：</lable>
														</div>
														<div class="public_formOther_container">
															<div class="layui-input-block">
																<input type="text" name="miniprogram_title{$key+1}" id="part_time_otype_mp_titles{$key+1}"    placeholder="请输入标题" autocomplete="off" class="layui-input part-time-form-elems" value="{$list['title']}">
															</div>
														</div>
													</div>
													<div class="public_form_List">
														<div class="public_formTitle_container">
															<lable class="layui-form-label">小程序封面：</lable>
														</div>
														<div class="public_formOther_container">
															<div class="layui-input-block">
																<img onerror="this.style.display='none'" id="preview_part_time_otype_mp_pics{$key+1}" class="part-time-img-previews" src="{$list['image']}" style="width: 100px; height: 100px;">
																<input type="hidden" name="miniprogram_pic{$key+1}" id="part_time_otype_mp_pics{$key+1}" class="part-time-form-elems" value="{$list['image']}" />
																<button type="button" class="layui-btn part-time-btn-simgs" onclick="select_img(this)" data-target="part_time_otype_mp_pics{$key+1}">
																	<i class="layui-icon">&#xe67c;</i>上传图片
																</button>
															</div>
														</div>
													</div>
												</div>
												<!-- <div class="public_form_List part-time-otype-items part_time_otype_reds" {if $list['type'] != 5} style="display: none;" {/if}>
													<div class="public_formTitle_container">
														<lable class="layui-form-label">红包：</lable>
													</div>
													<div class="public_formOther_container">
														<div class="layui-input-block">
															<select name="part_time_otype_reds{$key+1}" id="part_time_otype_reds{$key+1}" class="layui-input part-time-form-elems">
														        <option value="">请根据红包名称选择红包模板</option>
														        {loop $redguest as $redgues}
														        <option value="{$redgues->id}" {if $redgues->id == $list['red_id']} selected {/if}>{$redgues->red_name}</option>
														        {/loop}
														    </select>
														</div>
													</div>
												</div> -->
												<!-- 删除 -->
												<button type="button" class="layui-btn layui-btn-sm layui-btn-primary part-time-item-dels" style="position: absolute;z-index: 9;right: 0px;bottom: 0;">
													<i class="layui-icon">&#xe640;</i>
												</button>
											</div>
										</div>
									</div>
								{/loop}
							{/if}
						</div>
						<input type="hidden" id="partTimeCounts" name="part_time_counts" value="{count($promoteqr->welcome_list)?count($promoteqr->welcome_list):1}" />
						<div class="layui-form-item">
							<label class="layui-form-label"></label>
							<div class="layui-input-block">
								<button type="button" class="layui-btn layui-btn-primary part-time-btn-adds"style="color: #1E9FFF;border: 0;background: transparent;"><i class="layui-icon">&#xe608;</i> 添加附件
								</button>
							</div>
						</div>
					</div>
					<!-- 客户标签 -->
					<div class="layui-form-item">
						<label class="layui-form-label">客户标签：</label>
						<div class="layui-input-block">
							<div class="form-item-right-swicth-container">
								<input type="checkbox" lay-filter="tag_type" name="tag_type" lay-skin="switch" lay-text="已开启|已关闭" {if $promoteqr->is_tag == 1} checked {/if}>
								<span>开启后可为客户添加标签,方便企业运营</span>
							</div>

							<div class="rightHidden_container" id="customerLabel_container"  {if $promoteqr->is_tag != 1} style="display: none;" {/if}>
								<span class="add_active" >+ 添加</span>
								<ul class="customerLabel_mainList_content" id="selectedLableCon">
									{loop $promoteqr->tags as $tag}
										<li>
											<span>{$etTagArr[$tag]}</span>
										</li>
									{/loop}
								</ul>
								<input type="hidden" name="tags" id="seleckedLable" value="{implode(',',$promoteqr->tags)}">
							</div>
						</div>
					</div>

					<!-- 客户备注 -->
					<div class="layui-form-item">
						<label class="layui-form-label">客户备注：</label>
						<div class="layui-input-block">
							<div class="form-item-right-swicth-container">
								<input type="checkbox" lay-filter="is_bz" name="is_bz" lay-skin="switch" lay-text="已开启|已关闭" {if $promoteqr->is_bz == 1} checked{/if}>
								<span>开启后可为客户昵称加备注，方便查看客户来源</span>
							</div>
							<div class="rightHidden_container" id="customerRemarks_container" {if $promoteqr->is_bz != 1} style="display: none;" {/if}>
								<div class="customerRemarks_input_container">
									<span>客户昵称-</span>
									<input type="text" value="{$promoteqr->bz}" name="bz" id="bz"/>
								</div>
								<div class="customerRemarks_show_container">
									<label>预览：</label>
									<div class="customerRemarks_show_content">
										<img
											src="http://weidogstest.oss-cn-beijing.aliyuncs.com/dcf25b37c3b405bea13d5b96ab225574.jpg" />
										<span>客户昵称-</span>
										<b id="customerRemarks_nameText">{$promoteqr->bz}</b>
									</div>
								</div>
							</div>
						</div>
					</div>

					<!-- 客户描述 -->
					<div class="layui-form-item">
						<label class="layui-form-label">客户描述：</label>
						<div class="layui-input-block">
							<div class="form-item-right-swicth-container">
								<input type="checkbox" lay-filter="is_describe" name="is_describe" lay-skin="switch" lay-text="已开启|已关闭" {if $promoteqr->is_describe == 1} checked{/if}>
								<span>开启后可为客户添加描述，将在客户画像里展示</span>
							</div>
							<div class="rightHidden_container" id="customerDescribe_container" {if $promoteqr->is_describe != 1} style="display: none;" {/if}>
								<textarea placeholder="请输入客户描述" class="layui-textarea" id="describes">{$promoteqr->describe}</textarea>
								<input type="hidden" name="describe" id="describe">
							</div>
						</div>
					</div>

				</div>
				<!-- 客户群设置 -->
				<div class="CustomerGroupSettings_container" style="display: none;">
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							入群欢迎语：</label>
						<div class="layui-input-block" style="padding-top: 8px;">
							<textarea placeholder="欢迎加入客户沟通群！有任何问题都可以在群内咨询哦～" class="layui-textarea" id="group_welcomes">{$promoteqr->group_welcome}</textarea>
							<input type="hidden" name="group_welcome" id="group_welcome">
							<p class="enterGroupText">提示：企业需在移动端群管理处选择已经创建好的欢迎语才可生效哦</p>
						</div>
					</div>
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label"></label>
						<div class="layui-input-block">
							<div class="draggableTips_container">
								<div class="PopSetting_ExhibitionSwitch_customTips_content"  style="border: none;">
									<p>注意：</p>
									<div class="PopSetting_ExhibitionSwitch_customTipsText_content">
										<p>1、注意群聊二维码有效期为7天，需要及时更换哦，以防客户进群失效哦～</p>
										<p>2、上传群二维码请 仔细核对 ，群聊二维码和群聊 对应错误 将导致 客户进群失效哦~</p>
										<p>3、建议同一群聊不要应用于多个推广活动，可能导致群上限控制精度降低，出现客户无法正常加入群聊，或数据计算异常的情况</p>
									</div>
								</div>
							</div>
						</div>
					</div>
					
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							群聊二维码：</label>
						<div class="layui-input-block" style="padding-top: 8px;">
							<div class="public_iconTips_container">
								<svg t="1622540008125" class="icon" viewBox="0 0 1025 1024" version="1.1"
									xmlns="http://www.w3.org/2000/svg" p-id="4204" width="14" height="14">
									<path
										d="M595.138 889.173c16.52 0 29.914 13.393 29.914 29.913 0 16.521-13.393 29.914-29.914 29.914H436.563c-16.52 0-29.914-13.393-29.914-29.914 0-16.52 13.393-29.913 29.914-29.913h158.575z m-494.224-66.73C84.393 822.442 71 809.05 71 792.528s13.393-29.914 29.914-29.914h98.828V474.698c0-165.138 126.17-300.806 287.37-315.869l0.001-58.942C487.113 83.38 500.494 70 517 70s29.887 13.38 29.887 29.887l0.001 58.942c161.2 15.063 287.37 150.731 287.37 315.869l-0.001 287.917h98.83c16.52 0 29.913 13.393 29.913 29.914 0 16.52-13.393 29.913-29.914 29.913H100.914z"
										fill="#1990ff" p-id="4205"></path>
								</svg>
								<p>若群内添加了小助理机器人，请将【人数上限减1】，可能会导致客户进群失败 请注意操作修改时不可更改群聊二维码，请在创建时填写需要的群聊</p>
							</div>
							<div class="groupTalkQrCode_container">
								<ul class="groupTalkQrCode_list_container">
									{if $promoteqr->type == 2}
										{loop $promoteqr->group_data as $k=>$data}
											<li class="group_data">
												<div class="groupTalkQrCode_listTitle_container">
													<p class="group_size">* 群聊二维码{$k+1}:</p>
												</div>
												<div class="groupTalkQrCode_listMain_container">
													<div class="public_upImg_content">
														<div class="public_upImage_container">
															<img src="{$data['code']}" class="layui-upload-img customImgBG demo2 group_set" id="group_code_image{$k+1}">
														</div>
														<div class="groupTalkQrCode_listMainRight_container">
															<div class="groupTalkQrCode_listMainRight_addGroup_container">
																<div class="groupTalkQrCode_listMainRight_addGroup_content group_set" data-target="{$k+1}">+ 选择群聊</div>
																<div class="groupTalkQrCode_listMainRight_addGroupDetail_container group_set" id="group_list_data{$k+1}">
																	<img id="group_image{$k+1}" class="group_set" src="http://weidogstest.oss-cn-beijing.aliyuncs.com/9c449bc62e76a4bea37d0c5f493aa640.png" />
																	<div class="groupTalkQrCode_listMainRight_addGroupDetail_content">
																		<p id="group_name{$k+1}" class="group_set">{$h->get_group_chat($promoteqr->wid,$data['id'])["name"]}</p>
																		<span id="group_sum{$k+1}" class="group_set">{count(json_decode($h->get_group_chat($promoteqr->wid,$data['id'])["member_list"],1))}/200</span>
																	</div>
																</div>
															</div>
															<input type="hidden" class="group_set" name="group{$k+1}" id="group{$k+1}" value="{$data['id']}">
															<input type="hidden" class="group_set" name="group_code{$k+1}" id="group_code{$k+1}" value="{$data['code']}">
															<input type="hidden" class="group_set" name="size{$k+1}" id="size{$k+1}" value="{$data['size']}">
															<div class="groupTalkQrCode_listMainRight_number_container">
																<span>群人数上限：</span>
																<input type="text" name="size1" value="{$data['size']}" autocomplete="off" class="layui-input group_set" disabled>
															</div>
															<div class="groupTalkQrCode_listMainRight_uploadImg_container">
																<span data-target="{$k+1}" onclick="select_imgs(this)" class="group_set" >上传二维码</span>
															</div>
														</div>
													</div>
												</div>
												<!-- <svg class="removeGroupQrCode" t="1639126724868" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1565" width="200" height="200">
													<path d="M840 288H688v-56c0-40-32-72-72-72h-208C368 160 336 192 336 232V288h-152c-12.8 0-24 11.2-24 24s11.2 24 24 24h656c12.8 0 24-11.2 24-24s-11.2-24-24-24zM384 288v-56c0-12.8 11.2-24 24-24h208c12.8 0 24 11.2 24 24V288H384zM758.4 384c-12.8 0-24 11.2-24 24v363.2c0 24-19.2 44.8-44.8 44.8H332.8c-24 0-44.8-19.2-44.8-44.8V408c0-12.8-11.2-24-24-24s-24 11.2-24 24v363.2c0 51.2 41.6 92.8 92.8 92.8h358.4c51.2 0 92.8-41.6 92.8-92.8V408c-1.6-12.8-12.8-24-25.6-24z" p-id="1566"></path>
													<path d="M444.8 744v-336c0-12.8-11.2-24-24-24s-24 11.2-24 24v336c0 12.8 11.2 24 24 24s24-11.2 24-24zM627.2 744v-336c0-12.8-11.2-24-24-24s-24 11.2-24 24v336c0 12.8 11.2 24 24 24s24-11.2 24-24z" p-id="1567"></path>
												</svg> -->
											</li>
										{/loop}
									{/if}
								</ul>
								<!-- <div class="addGroupButton_container">
									<span>+</span>
									<p>请选择群聊</p>
								</div> -->
							</div>
						</div>
					</div>
				</div>
				<!-- 海报设置 -->
				<div class="PosterSettings_container" style="display: none;">
					<div class="layui-form-item">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							页面标题:
						</label>
						<div class="layui-input-block">
							<input type="text" name="h5_title" value="{$promoteqr->h5_title}"  placeholder="例：扫码加入专属福利群" autocomplete="off" class="layui-input" lay-verify="required">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							<span style="color: red;">*</span>
							推广页面:
						</label>
						<div class="layui-input-block" id="TGPageRadio">
							<input type="radio" lay-filter="h5_type" name="h5_type" value="1" title="默认样式" {if $promoteqr->h5_type == 1} checked {/if}>
							<input type="radio" lay-filter="h5_type" name="h5_type" value="2" title="自定义样式"{if $promoteqr->h5_type == 2} checked {/if}>
						</div>
					</div>
					<div class="TGPage_default_container" {if $promoteqr->h5_type != 1} style="display: none;" {/if} >
						<div class="layui-form-item">
							<label class="layui-form-label">
								<span style="color: red;">*</span>
								企业LOGO:
							</label>
							<div class="layui-input-block">
								<img src="{$promoteqr->h5_one_logo}"
									style="width: 100px; height: 100px;" id="logo">
								<button type="button" class="layui-btn" onclick="select_img(this)" data-target="logo">
									<i class="layui-icon">&#xe67c;</i>上传图片
								</button>
								<input type="hidden" name="h5_one_logo" id="h5_one_logo" value="{$promoteqr->h5_one_logo}" lay-verify="required">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">
								<span style="color: red;">*</span>
								企业名称:
							</label>
							<div class="layui-input-block">
								<input type="text" name="h5_one_qyname" value="{$promoteqr->h5_one_qyname}" id="h5_one_qyname"  placeholder="请输入名称" autocomplete="off" class="layui-input" lay-verify="required">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">企业介绍：</label>
							<div class="layui-input-block">
								<div class="form-item-right-swicth-container">
									<input type="checkbox" lay-filter="h5_one_is_introduce" name="h5_one_is_introduce"  lay-skin="switch" lay-text="已开启|已关闭" {if $promoteqr->h5_one_is_introduce == 1} checked {/if}>
								</div>
								<div class="rightHidden_container" id="companyIntroduce_container"{if $promoteqr->h5_one_is_introduce != 1} style="display: none;" {/if} >
									<input type="text" name="h5_one_introduce" id="h5_one_introduce"  placeholder="请输入企业介绍" autocomplete="off" class="layui-input" value="{$promoteqr->h5_one_introduce}">
								</div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">
								<span style="color: red;">*</span>
								扫码引导语:
							</label>
							<div class="layui-input-block">
								<input type="text" name="h5_one_guidance" id="h5_one_guidance"  placeholder="例:扫码加入专属福利群" autocomplete="off" class="layui-input" lay-verify="required" value="{$promoteqr->h5_one_guidance}">
							</div>
						</div>
					</div>
					<div class="TGPage_custom_container" {if $promoteqr->h5_type != 2} style="display: none;" {/if} >
						<div class="layui-form-item">
							<label class="layui-form-label">
								<span style="color: red;">*</span>
								海报:
							</label>
							<div class="layui-input-block">
								<div class="draggable_container">
									<div class="PopSetting_ExhibitionSwitch_customImg_container">
										<div class="PopSetting_ExhibitionSwitch_customImg_content">
											<img src="{$promoteqr->h5_tow_bg}" class="layui-upload-img customImgBG demo1" id="bglogo">
											<div class="AbsoluteQrcode PublicAbsoluteQrcode phoneQrcodeImg" {if $promoteqr->h5_type != 2} style="display: none;" {/if} id="draggable"  style="left: {$promoteqr->h5_tow_style['left']}px; top: {$promoteqr->h5_tow_style['tops']}px;">
												<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4d2d2764c19d0b6962fe41eaec2b7c07.png">
											</div>
											<p class="PublicAbsoluteQrcodeText">请点击右下角上传背景图</p>
											<input type="hidden" name="h5_tow_bg" id="h5_tow_bg" value="{$promoteqr->h5_tow_bg}">
										</div>
										<span type="button" onclick="select_img(this)" data-target="bglogo">上传图片</span>
									</div>
									<input type="hidden" name="imgurl_left" id="imgurl_left" value="{$promoteqr->h5_tow_style['left']}">
									<input type="hidden" name="imgurl_top" id="imgurl_top" value="{$promoteqr->h5_tow_style['top']}">
									<div class="draggableTips_container">
										<div class="PopSetting_ExhibitionSwitch_customTips_content">
											<p>海报设计须知：</p>
											<div class="PopSetting_ExhibitionSwitch_customTipsText_content">
												<p>1、尺寸：720*1280，分辨率72</p>
												<p>2、海报其他部分皆可自定义设计</p>
												<p>3、海报大小不超过2M</p>
												<p>4、二维码最小尺寸48*48</p>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- 当前步骤 隐藏数据框 -->
				<input value="{$promoteqr->type}" id="nowStep" hidden>
				<input value="{count($promoteqr->group_data)?:1}" id="group_length" hidden name="group_length">
			</div>
		</form>
	</div>
	<script src="/cdn/jquery.js"></script>
	<script src="/layui/layui.js"></script>
	<script src="/js/ajax.js"></script>
	<script type="text/javascript">
		// 弹窗
		layui.use('layer', function () {
			var layer = layui.layer;
		});
		// 表单
		layui.use('form', function () {
			var form = layui.form;

			//监听提交
			form.on('submit(formDemo)', function (data) {
				$("#task_state").val($("#task_states").val());
				$("#promotion_welcome").val($("#promotion_welcomes").val());
				$("#welcome_text").val($("#edit_hy_text_content_div").html());
				$("#describe").val($("#describes").val());
				$("#group_welcome").val($("#group_welcomes").val());
				if($("#describe").val().length > 150){
					layer.msg('描述最多只能有150个字符')
					return false;
				}
				if($("#bz").val().length > 20){
					layer.msg('客户备注最多只能有20个字符')
					return false;
				}
				var formData = $('#form1').serialize();
				myAjaxPost(false, true, 'edit_promoteqr-{$id}.html', formData, function (resp) {
					layer.msg(resp.msg)
					if (resp.status == 'success') {
						setTimeout(function(){
							location.href = 'index.html';
						},2000);
					}
				})
				return false;
			});
			// 每日提醒 
			form.on('switch(day)', function (data) {
				console.log(data.elem.checked); //是否被选中，true或者false
				if (data.elem.checked == true) {
					$('#test4').attr("lay-verify","required");
					$(".everyDayTipsDown_content").show();
				} else {
					$('#test4').attr("lay-verify","false");
					$(".everyDayTipsDown_content").hide();
				}
				form.render();
			});
			// 推广码失效时间
			form.on('radio(TGtime)', function (data) {
				if ($('#tgCustomTimeSwitch input[name="TGtime"]:checked').val() == "1") {
					$('#test5').attr("lay-verify","false");
					$("#tgCustomTime").hide();
				} else if ($('#tgCustomTimeSwitch input[name="TGtime"]:checked').val() == "2") {
					$('#test5').attr("lay-verify","required");
					$("#tgCustomTime").show();
				}

				form.render();
			});
			// 欢迎语
			form.on('radio(welcomeWords)', function (data) {
				if ($('#welcomeWordsSwitch input[name="welcomeWords"]:checked').val() == "2") {
					// $('#welcome_text').attr("lay-verify","false");
					$("#welcome_Container").hide();
					$("#part-time-lists").hide();
				} else if ($('#welcomeWordsSwitch input[name="welcomeWords"]:checked').val() == "1") {
					// $('#welcome_text').attr("lay-verify","required");
					$("#welcome_Container").show();
					$("#part-time-lists").show();
				}
				form.render();
			});
			// 推广码类型
			form.on('radio(TGtype)', function (data) {
				if ($('#TGtypeRadio input[name="type"]:checked').val() == "1") {
					$("#Step2").text("客户设置");
					// $('#welcome_text').attr("lay-verify","required");
					// $('#group_welcome').attr("lay-verify","false");
					$('#group1').attr("lay-verify","false");
					$('#group_code1').attr("lay-verify","false");
					$("#nowStep").val('1');
				} else if ($('#TGtypeRadio input[name="type"]:checked').val() == "2") {
					$("#Step2").text("客户群设置");
					// $('#welcome_text').attr("lay-verify","false");
					// $('#group_welcome').attr("lay-verify","required");
					$('#group1').attr("lay-verify","required");
					$('#group_code1').attr("lay-verify","required");
					$("#nowStep").val('2');
				}

				form.render();
			});
			// 推广页面 TGPage
			form.on('radio(h5_type)', function (data) {
				if ($('#TGPageRadio input[name="h5_type"]:checked').val() == "1") {
					$('#h5_one_logo').attr("lay-verify","required");
					$('#h5_one_qyname').attr("lay-verify","required");
					$('#h5_one_guidance').attr("lay-verify","required");
					$('#h5_one_guidance').attr("lay-verify","false");
					$(".TGPage_custom_container").hide();
					$(".TGPage_default_container").show();
				} else if ($('#TGPageRadio input[name="h5_type"]:checked').val() == "2") {
					$('#h5_one_logo').attr("lay-verify","false");
					$('#h5_one_qyname').attr("lay-verify","false");
					$('#h5_one_guidance').attr("lay-verify","required");
					$('#h5_tow_bg').attr("lay-verify","false");
					$(".TGPage_default_container").hide();
					$(".TGPage_custom_container").show();
				}
				form.render();
			});
			// 客户标签 
			form.on('switch(tag_type)', function (data) {
				console.log(data.elem.checked); //是否被选中，true或者false
				if (data.elem.checked == true) {
					$('#seleckedLable').attr("lay-verify","required");
					$("#customerLabel_container").show();
				} else {
					$('#seleckedLable').attr("lay-verify","false");
					$("#customerLabel_container").hide();
				}
				form.render();
			});
			// 客户备注 
			form.on('switch(is_bz)', function (data) {
				console.log(data.elem.checked); //是否被选中，true或者false
				if (data.elem.checked == true) {
					$('#bz').attr("lay-verify","required");
					$("#customerRemarks_container").show();
				} else {
					$('#bz').attr("lay-verify","false");
					$("#customerRemarks_container").hide();
				}
				form.render();
			});
			// 客户描述 
			form.on('switch(is_describe)', function (data) {
				console.log(data.elem.checked); //是否被选中，true或者false
				if (data.elem.checked == true) {
					$("#customerDescribe_container").show();
				} else {
					$("#customerDescribe_container").hide();
				}
				form.render();
			});
			// 企业介绍 h5_one_is_introduce
			form.on('switch(h5_one_is_introduce)', function (data) {
				console.log(data.elem.checked); //是否被选中，true或者false
				if (data.elem.checked == true) {
					$('#h5_one_is_introduce').attr("lay-verify","required");
					$("#companyIntroduce_container").show();
				} else {
					$('#h5_one_is_introduce').attr("lay-verify","false");
					$("#companyIntroduce_container").hide();
				}
				form.render();
			});
		});
		layui.use('laydate', function () {
			var laydate = layui.laydate;
			//时间选择器
			laydate.render({
				elem: '#test4'
				, type: 'time'
			});
			//日期时间选择器
			laydate.render({
				elem: '#test5'
				, type: 'datetime'
			});
		});
	</script>
	<script type="text/javascript">
		// 在光标位置插入html代码，如果dom没有获取到焦点则追加到最后
		window.onload = function () {
			function insertAtCursor(jsDom, html) {
				if (jsDom != document.activeElement) { // 如果dom没有获取到焦点，追加
					jsDom.innerHTML = jsDom.innerHTML + html;
					return;
				}
				var sel, range;
				if (window.getSelection) {
					// IE9 或 非IE浏览器
					sel = window.getSelection();
					if (sel.getRangeAt && sel.rangeCount) {
						range = sel.getRangeAt(0);
						range.deleteContents();
						// Range.createContextualFragment() would be useful here but is
						// non-standard and not supported in all browsers (IE9, for one)
						var el = document.createElement("div");
						el.innerHTML = html;
						var frag = document.createDocumentFragment(),
							node, lastNode;
						while ((node = el.firstChild)) {
							lastNode = frag.appendChild(node);
						}
						range.insertNode(frag);
						// Preserve the selection
						if (lastNode) {
							range = range.cloneRange();
							range.setStartAfter(lastNode);
							range.collapse(true);
							sel.removeAllRanges();
							sel.addRange(range);
						}
					}
				} else if (document.selection && document.selection.type != "Control") {
					// IE < 9
					document.selection.createRange().pasteHTML(html);
				}
			}

			//  点击插入
			document.getElementById('insert').onclick = function () {
				var html = '<font style="color: green;">用户昵称</font>&nbsp;';
				insertAtCursor(document.getElementById('edit_hy_text_content_div'), html);
			};
		}
	</script>
	<!-- 客户标签部分 -->
	<script type="text/javascript">
		$('.add_active').click(function () {
			layer.open({
				type: 2,
				title: '请选择员工',
				shadeClose: true,
				shade: 0.2,
				area: ['700px', '600px'],
				content: 'select_tag.html'
			});
		})
		$('body').on('click', '.deleteLabel', function () {
			$(this).parent().remove();
		})
		// 客户备注 
		$('.customerRemarks_input_container input').bind('input propertychange', function () {
			$("#customerRemarks_nameText").text($(this).val())
		});
	</script>
	<!-- 拖拽 -->
	<script type="text/javascript">
		var divs = document.querySelector('#draggable');
		//元素的鼠标落下事件
		divs.onmousedown = function (ev) {

			//event的兼容性
			var ev = ev || event;

			//获取鼠标按下的坐标
			var x1 = ev.clientX;
			var y1 = ev.clientY;

			//获取元素的left，top值
			var l = divs.offsetLeft;
			var t = divs.offsetTop;

			//给可视区域添加鼠标的移动事件
			document.onmousemove = function (ev) {

				//event的兼容性
				var ev = ev || event;

				//获取鼠标移动时的坐标
				var x2 = ev.clientX;
				var y2 = ev.clientY;

				//计算出鼠标的移动距离
				var x = x2 - x1;
				var y = y2 - y1;

				//移动的数值与元素的left，top相加，得出元素的移动的距离
				var lt = y + t;
				var ls = x + l;
				if (lt >= 247) {
					lt = 247
				}
				if (lt <= 0) {
					lt = 0
				}
				if (ls <= 0) {
					ls = 0
				}
				if (ls >= 117) {
					ls = 117
				}
				//更改元素的left，top值
				divs.style.top = lt + 'px';
				divs.style.left = ls + 'px';
				$('.phoneQrcodeImg').css('left', ls * 2.24 + 'px');
				$('.phoneQrcodeImg').css('top', lt * 2.24 + 'px');
				$('#imgurl_left').val(ls);
				$('#imgurl_top').val(lt);
			}

			//清除
			document.onmouseup = function (ev) {

				document.onmousemove = null;

			}

		}
	</script>
	<script>
		// 上一步
		$('.prevButton').click(function(){
			console.log($("#nowStep").val());
			if($("#nowStep").val() == 3){
				$(".CustomerSettings_container").hide();
				$(".BasicSettings_container").show();
				$(".secendStep").removeClass('acticeProgress')
				$(".firstStep").addClass('acticeProgress')
				$("#nowStep").val('1')
			}else if($("#nowStep").val() == 4){
				$(".CustomerGroupSettings_container").hide();
				$(".BasicSettings_container").show();
				$(".secendStep").removeClass('acticeProgress')
				$(".firstStep").addClass('acticeProgress')
				$("#nowStep").val('2')
			}else if($("#nowStep").val() == 6){
				$(".PosterSettings_container").hide();
				$(".CustomerSettings_container").show();
				$(".thirdStep").removeClass('acticeProgress')
				$(".secendStep").addClass('acticeProgress')
				$("#nowStep").val('3')
			}else if($("#nowStep").val() == 8){
				$(".PosterSettings_container").hide();
				$(".CustomerGroupSettings_container").show();
				$(".thirdStep").removeClass('acticeProgress')
				$(".secendStep").addClass('acticeProgress')
				$("#nowStep").val('4')
			}
			console.log($("#nowStep").val());
		})
		// 下一步
		$('.nextButtons').click(function(){
			console.log($("#nowStep").val());
			if($("#nowStep").val() == 1){
				$(".BasicSettings_container").hide();
				$(".CustomerSettings_container").show();
				$(".firstStep").removeClass('acticeProgress')
				$(".secendStep").addClass('acticeProgress')
				$("#nowStep").val('3')
			}else if($("#nowStep").val() == 2){
				$(".BasicSettings_container").hide();
				$(".CustomerGroupSettings_container").show();
				$(".firstStep").removeClass('acticeProgress')
				$(".secendStep").addClass('acticeProgress')
				$("#nowStep").val('4')
			}else if($("#nowStep").val() == 3){
				$(".CustomerSettings_container").hide();
				$(".CustomerGroupSettings_container").hide();
				$(".PosterSettings_container").show();
				$(".secendStep").removeClass('acticeProgress')
				$(".thirdStep").addClass('acticeProgress')
				$("#nowStep").val('6')
			}else if($("#nowStep").val() == 4){
				$(".CustomerSettings_container").hide();
				$(".CustomerGroupSettings_container").hide();
				$(".PosterSettings_container").show();
				$(".secendStep").removeClass('acticeProgress')
				$(".thirdStep").addClass('acticeProgress')
				$("#nowStep").val('8')
			}
			console.log($("#nowStep").val());
		})
		// 点击推广成员
		$("#addPeople").click(function(){
			layer.open({
				type: 2,
				title: '请选择标签',
				shadeClose: true,
				shade: 0.2,
				area: ['700px', '600px'],
				content: 'select_user.html'
			});
		})
		// $('body').on('click', '.groupTalkQrCode_listMainRight_addGroup_content', function () {
		// 	layer.open({
		// 		type: 2,
		// 		title: '请选择群聊',
		// 		shadeClose: true,
		// 		shade: 0.2,
		// 		area: ['700px', '600px'],
		// 		content: 'select_group-'+$(this).data("target")+'.html'
		// 	});
		// })
		
	</script>
<script type="text/javascript">
	// 添加时间段
function addOnePartTimes() {
	var $items = $('.part-time-lists .part-time-items')
	var length = $items.length
	if($('.part-time-lists .part-time-items').length >= 9){
		layer.msg('最多只能有九个附件')
		return false;
	}
	var tpl = $items.eq(0).clone(false)
		setPartTimeItemIds(tpl, length + 1, true)
		$(".part-time-lists").append(tpl)
		layui.form.render()
		layui.laydate.render({
			elem: '#part_time_moment' + (length + 1)
			,type: 'time'
			,range: '~'
			,format: 'HH:mm'
		})
		setCounts(length + 1)

}
function setPartTimeItemIds($item, index, clear) {
	$item.find('.part-time-item-indexs').text('附件' + index + '：')
	var $inputs = $item.find('.part-time-form-elems')
	for (var i = 0, l = $inputs.length; i < l; i++) {
		var $theInput = $($inputs[i])
		if (clear && $theInput.attr('type') !== 'radio') {
			$theInput.val('')
		}
		setElemAttrs($theInput, index)
	}
	var $prevImgs = $item.find('.part-time-img-previews')
	for (var i = 0, l = $prevImgs.length; i < l; i++) {
		setElemAttrs($($prevImgs[i]), index)
	}
	var $sImgBtns = $item.find('.part-time-btn-simgs')
	for (var i = 0, l = $sImgBtns.length; i < l; i++) {
		setElemAttrs($($sImgBtns[i]), index)
	}
	return $item
}
function setElemAttrs($elem, index) {
	var id = $elem.attr('id'), name = $elem.attr('name'), _name = $elem.attr('_name'), dataTarget = $elem.attr('data-target'), layKey = $elem.attr('lay-key'), xmSelect = $elem.attr('xm-select');
	var reg = /([0-9]+)/g
	$elem.attr({
		id: id && (id.replace(reg, '') + index),
		name: name && (name.replace(reg, '') + index),
		'data-target': dataTarget && (dataTarget.replace(reg, '') + index), // 上传图片按钮
		'_name': _name && (_name.replace(reg, '') + index), // 日期多选
		'xm-select': xmSelect && (xmSelect.replace(reg, '') + index), // 日期多选
		'lay-key': layKey ? (String(index) + Date.now()) : layKey, // 时间选择器
	});
}
// 添加时间段按钮
$('.part-time-btn-adds').on('click', addOnePartTimes)
// 删除时间段
$('.part-time-lists').on('click', '.part-time-item-dels', function() {
	if ($('.part-time-lists .part-time-items').length <= 1) {
		layer.msg('至少需要一个附件信息，不可删除')
	} else {
		$(this).parent().parent().parent().remove()
		updateItemsOrders()
	}
})
function updateItemsOrders() {
	var $items = $('.part-time-lists .part-time-items')
	var l = $items.length
	setCounts(l)
	for (var i = 0; i < l; i++) {
		var $theItem = $($items[i])
		setPartTimeItemIds($theItem, i + 1, false)
	}
	layui.form.render()
}

function setCounts(n) {
	if (n === undefined) {
		n = $('.part-time-lists .part-time-items').length
	}
	$('#partTimeCounts').val(n)
}

layui.use('form', function(){
	var form = layui.form;
  // 其他类型 切换
  form.on('radio(partTimeOtherTypes)', function (data) {
		var $itemWrap = $(this).parents('.part-time-items')
		var val = $itemWrap.find('input[lay-filter="partTimeOtherTypes"]:checked').val()

		$itemWrap.find('.part-time-otype-items').hide()
		$itemWrap.find('.part-time-form-elems').removeAttr("lay-verify");

		var theTypeBoxClass = null
		if (val == 2) {
			theTypeBoxClass = '.part_time_otype_imgs'
		} else if (val == 3) {
			theTypeBoxClass = '.part_time_otype_imgtexts'
		} else if (val == 4) {
			theTypeBoxClass = '.part_time_otype_mps'
		}else if (val == 5) {
			theTypeBoxClass = '.part_time_otype_reds'
		}
		if (theTypeBoxClass) {
			var $theTypeBox = $itemWrap.find(theTypeBoxClass)
			// $theTypeBox.find('.part-time-form-elems').attr("lay-verify","required");
			$theTypeBox.show()
		}
		form.render();
	});
});
</script>
<script type="text/javascript">
	// 添加时间段
function addOne() {
	var $items = $('.groupTalkQrCode_list_container .group_data')
	var length = $items.length
	var tpl = $items.eq(0).clone(false)
		setPartTimeItemId(tpl, length + 1, true)
		$(".groupTalkQrCode_list_container").append(tpl)
		layui.form.render()
		setCount(length + 1)

}
function setPartTimeItemId($item, index, clear) {
	$item.find('.group_size').text('群聊二维码' + index + '：')
	var $inputs = $item.find('.part-time-form-elems')
	var $sImgBtns = $item.find('.group_set')
	for (var i = 0, l = $sImgBtns.length; i < l; i++) {
		setElemAttr($($sImgBtns[i]), index)
	}
	return $item
}
function setElemAttr($elem, index) {
	var id = $elem.attr('id'), name = $elem.attr('name'), _name = $elem.attr('_name'), dataTarget = $elem.attr('data-target'), layKey = $elem.attr('lay-key'), xmSelect = $elem.attr('xm-select');
	var reg = /([0-9]+)/g
	$elem.attr({
		id: id && (id.replace(reg, '') + index),
		name: name && (name.replace(reg, '') + index),
		'data-target': dataTarget && (dataTarget.replace(reg, '') + index), // 上传图片按钮
		'_name': _name && (_name.replace(reg, '') + index), // 日期多选
		'xm-select': xmSelect && (xmSelect.replace(reg, '') + index), // 日期多选
		'lay-key': layKey ? (String(index) + Date.now()) : layKey, // 时间选择器
	});
}
// 添加时间段按钮
$('.addGroupButton_container').on('click', addOne)
// 删除时间段
$('.groupTalkQrCode_list_container').on('click', '.removeGroupQrCode', function() {
	if ($('.groupTalkQrCode_list_container .group_data').length <= 1) {
		layer.msg('至少保留一个群聊数据')
	} else {
		$(this).parent().remove()
		updateItemsOrder()
	}
})
function updateItemsOrder() {
	var $items = $('.groupTalkQrCode_list_container .group_data')
	var l = $items.length
	setCount(l)
	for (var i = 0; i < l; i++) {
		var $theItem = $($items[i])
		setPartTimeItemId($theItem, i + 1, false)
	}
	layui.form.render()
}

function setCount(n) {
	if (n === undefined) {
		n = $('.groupTalkQrCode_list_container .group_data').length
	}
	$('#group_length').val(n)
}
</script>
<script type="text/javascript">
	function select_imgs(t){
		var targetId = $(t).data("target");
		layer.open({
			title:'图片库',
			type: 2,
			area: ['700px', '450px'],
			fixed: false, //不固定
			maxmin: false,
			content: '/imgLib/lib.html?type=vshop_img&target='+targetId
		});
	}

	function select_img(a){
	  var targetId=a.getAttribute('data-target');
	  layer.open({
		title:'图片库',
		type: 2,
		area: ['700px', '450px'],
		fixed: false, //不固定
		maxmin: false,
		content: '/imgLib/lib.html?type=vshop_img&target='+targetId
	  });
	}

	window.uploadImgCallback=function (tgt,url) {
	  console.log('选择图片结果',tgt,url);
	  if(tgt=='image'){
		var inputEle=$('#image');
		var prevEle=$('#pic_image');
		inputEle.val(url);
		prevEle.attr('src',url);
		prevEle.show();
	  }else if(tgt=='link_pic'){
		var inputEle=$('#link_pic');
		var prevEle=$('#pic_link_pic');
		inputEle.val(url);
		prevEle.attr('src',url);
		prevEle.show();
	  }else if(tgt=='miniprogram_pic'){
		var inputEle=$('#miniprogram_pic');
		var prevEle=$('#pic_miniprogram_pic');
		inputEle.val(url);
		prevEle.attr('src',url);
		prevEle.show();
	  }else if(tgt.indexOf('part_time_') > -1){ // 分时段 通用
		var inputEle=$('#' + tgt);
		var prevEle=$('#preview_' + tgt);
		inputEle.val(url);
		prevEle.attr('src',url);
		prevEle.show();
	  }else if(tgt=='logo'){ // 分时段 通用
		var inputEle=$('#h5_one_logo');
		var prevEle=$('#logo');
		inputEle.val(url);
		prevEle.attr('src',url);
	  }else if(tgt=='bglogo'){ // 分时段 通用
		var inputEle=$('#h5_tow_bg');
		var prevEle=$('#bglogo');
		inputEle.val(url);
		prevEle.attr('src',url);
		$("#draggable").show();
	  }else{
	  	var inputEle=$('#group_code'+tgt);
		var prevEle=$('#group_code_image'+tgt);
		inputEle.val(url);
		prevEle.attr('src',url);
	  }
	};
</script>
</body>

</html>